<div class="panes_vertical">
	<div class="box">	
		<form method="post" action="<{$APPLICATION_URL}>/Admin/Banner/add" name="frmForm" enctype="multipart/form-data">
			<fieldset>
				<legend>Add Main Banner (Homepage)</legend>
				<{if $resultMessage != ''}>										
				<p>
					<span style="color:blue"><{$resultMessage}></span>					
				</p>
				<{/if}>
				<p>
					<label>Title:</label>
					<input type='text' id='title' name='title' value='<{$title}>' class="textfield">					
				</p>
				<p>
					<label>url:</label>
					<input type='url' id='url' name='url' value="<{if $url eq ''}>http://<{else}><{$url}><{/if}>" class="textfield">					
				</p>
				<p>
					<label>Picture:</label>
					<input type='file' id='picture' name='picture' class="textfield">					
				</p>
				<p>
					<label>Description:</label>
					<textarea name="description" id="description" rows="5" cols="43"><{$description}></textarea>				
				</p>
				<p>
					<label>Status:</label>
					<select name="status" id="select">
						<option value=''>-- Select one --</option>
						<{html_options options = $statusList selected=$status}>
					</select>
				</p>
				<p>
					<input type="button" name="save" class="button" id="save" value=" Submit " onclick="formSubmit();" />
					<input type="reset" name="reset" class="button" id="reset" value=" Reset " />										
					<input type="hidden" id="id" name="id" value="<{$id}>" />
					<input type="hidden" id="actionForm" name="actionForm" value=""/>
					<input type="hidden" id="actionKey" name="actionKey" value="<{$actionKey}>" />
				</p>
			</fieldset>
		</form>
	</div>
</div>

<script type="text/javascript">
    function formSubmit()
    {
    	var theform = document.frmForm;

    	// Check title
    	var title = theform.title.value;
    	if (title == ''){
			alert('Title is invalid');
			theform.title.focus();
			return false;
    	}

    	// Check URL
    	var url = theform.url.value;
		if (url.length != 0 && !isURL(url)) {
			alert("The URL is invalid! Example: http://yourdomain.com");
			theform.url.focus();
			return false;
		}
		
    	// Check Picture
    	var picture = theform.picture.value;
    	if (picture == ''){
			alert('Please choose picture');
			return false;
    	}

    	// Check status
    	var status = theform.status.value;
    	if (status == ''){
			alert('Status is invalid');
			theform.status.focus();
			return false;
    	}

    	theform.actionForm.value = 'submit';
    	theform.submit();
    	return true;
    }
</script>